//
//  IMError.h
//  IMSecurity
//
//  Created by infosec2013 on 16/6/29.
//  Copyright © 2016年 IF. All rights reserved.
//

#import <Foundation/Foundation.h>

//ERROR
#define IM_ER_SUCCESS                   000000
#define IM_ER_UNKONWN_EXCEPTION         999999

//常规错误
#define IM_ER_NETWORK                   101000
#define IM_ER_INVALID_PARAM             101002
#define IM_ER_INVALID_FILE              101003
#define IM_ER_UPLOAD_FILE               101004
#define IM_ER_WRITE_FILE                101005
#define IM_ER_DOWNLOAD_FILE             101006
#define IM_ER_GET_SERVER_MODE           101007
#define IM_ER_NEED_MORE_PARAM           101008
#define IM_ER_NEED_PARAM_OTP_SEED       101009
#define IM_ER_NEED_PARAM_APPID_AND_APPSECRET 101010
#define IM_ER_NOT_SUPPORT_HOMO_SIGNMODE    101011
#define IM_ER_BUFFER_IS_TOO_SMALL       101012
#define IM_ER_NOT_SUPPORT_PDF_SIGNATRUE 101013
#define IM_ER_NOT_SUPPORT_CERT          101014
#define IM_ER_NOT_SUPPORT_TOKEN         101015
#define IM_ER_NOT_SUPPORT_DOUBLE_CERT   101016


//用户
#define IM_ER_USER_NOT_FOUND            102001
#define IM_ER_REGIST_INFO_INVALID       102002
#define IM_ER_USER_NOT_REVIEWD          102003
#define IM_ER_USER_FORMAT_INVALID       102004
#define IM_ER_USER_NAME_NULL            102005
#define IM_ER_LOCKTRADE_NULL            102006
#define IM_ER_LOCKTRADE_FORMAT          102007
#define IM_ER_LOCK_TRADE_NVALID         102008
#define IM_ER_IMEI_NULL                 102009
#define IM_ER_DEVICE_HAS_BEEN_REGIST    102010
#define IM_ER_USER_HAS_BEEN_RESET       102011
#define IM_ER_LOCK_USER_FAILED          102012
#define IM_ER_VERIFY_PIN                102013
#define IM_ER_CHANGE_PIN                102014
#define IM_ER_UNAUTHORIZED              102015
#define IM_ER_GET_USER_STATE            102016
#define IM_ER_INVALID_USER_TYPE         102017
#define IM_ER_IMPORT_CERT_AND_SEED      102018
#define IM_ER_GET_CERT_AND_SEED         102019
#define IM_ER_USER_HAS_BEEN_LOCKED      102020
#define IM_ER_USER_DEVICE_REACH_MAX_NUM 102021
#define IM_ER_VERIFY_MSG_INFO_FAILED    102022
#define IM_ER_UNSUPPORT_CLIENT_REGIST   102023
#define IM_ER_INVALID_PHONE_NUMBER      102024
#define IM_ER_INVALID_EMAIL             102025

//证书
#define IM_ER_GET_CERT_FAILED           103001
#define IM_ER_CERT_HAS_EXIST            103002
#define IM_ER_CERT_NOT_EXIST            103003
#define IM_ER_CERT_HAS_BEEN_INVALID     103004
#define IM_ER_CERT_HAS_REVIEW_RECORD    103005
#define IM_ER_LOGIN_WITH_QRCODE_FAILED  103006
#define IM_ER_CERT_HAS_BEEN_FREEZE      103007
#define IM_ER_VERIFY_SIGN_FAILED        103008
#define IM_ER_IMPORT_CERT_FAILED        103009
#define IM_ER_GET_CERT_STATE_FAILED     103010
#define IM_ER_GEN_HOME_KEY_PAIRS        103011
#define IM_ER_HOMO_SIGN_COMPLETE_FAILED 103012
#define IM_ER_GENERATE_P10              103013
#define IM_ER_CERT_STATUS_ABNORMAL      103014
#define IM_ER_ENC_DATA_FAILED           103015
#define IM_ER_DEC_DATA_FAILED           103016
#define IM_ER_MAKE_ENV_FAILED           103017
#define IM_ER_OPEN_ENV_FAIELD           103018
#define IM_ER_SIGN_DIGEST_FAILED        103019
#define IM_ER_HOMO_SIGN_INIT_FAILED     103020
#define IM_ER_SIGN_DATA_FAILED          103021
#define IM_ER_HOMO_DECRYPT_FAILED      103022

//令牌
#define IM_ER_TOKEN_HAS_BEEN_FREEZE     104001
#define IM_ER_TOKEN_HAS_BEEN_INVALID    104002
#define IM_ER_TOKEN_GET_SEED_FAILED     104003
#define IM_ER_TOKEN_GENERATE_FAILED     104004
#define IM_ER_TOKEN_SEED_IMPORT_FAILED  104005
#define IM_ER_GET_TOKEN_INFO            104006
#define IM_ER_GET_ACCESS_TOKEN          104007
#define IM_ER_GET_TOKEN_STATE_FAILD     104008
#define IM_ER_GEN_PROTECTION_KEY_FAILED 104009
#define IM_ER_TOKEN_HAS_APPLY_SEED      104010
#define IM_ER_TOKEN_SEED_NOT_EXIST      104011

//应用
#define IM_ER_GET_APPS_NULL             105001
#define IM_ER_GET_APP_MESSAGE           105002
#define IM_ER_GET_SYS_APP_VERSION       105003

//HTTP
#define IM_ER_INVALID_CONTENTYPE        106001
#define IM_ER_ROOT_CERTS_INVALID_PATH   106002

//签章
#define IM_ER_REGIST_STAMPER            107001
#define IM_ER_GET_STAMPER               107002
#define IM_ER_STAMPER_NOT_EXIST         107003
#define IM_ER_STAMPER_UNDER_REVIEW      107004
#define IM_ER_PDF_QRCODE_TIMEOUT        107005
#define IM_ER_ID_NOT_MATCH              107006
#define IM_ER_GET_PDF_URL               107007
#define IM_ER_PDF_FILE_NOT_EXIST        107008
#define IM_ER_PDF_FILE_EXCEED_MAX_SIZE  107009
#define IM_ER_INVALID_FILE_DOWNLOAD_URL 107010
#define IM_ER_PDF_FILE_EXCEPTION        107011
#define IM_ER_STAMPER_HAS_REGIST        107012

#define IM_ER_BIND_PC                           108001
#define IM_ER_REACH_MAXIUM_DEVICE_NUMBERS       108002
#define IM_ER_PC_DEVICE_NOT_EXIST               108003
#define IM_ER_SCAN_WRONG_QRCODE                 108004

//其他
#define IM_ER_PDF_SIGNATURE             109001
#define IM_ER_PRE_SIGNDATA_NULL         109002
#define IM_ER_OTPNUM                    109003
#define IM_ER_INVALID_QR                109004
#define IM_ER_DECRYPT_FAIL              109005
#define IM_ER_QR_TIMEOUT                109006

//网络通信
#define IM_ER_SSL_CREATE_HANDLE         110006

@interface IMError : NSObject

+ (NSString *)getMsgWithErr:(int)err;

@end
